<!--
*Author：富行天下团队
 *
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mall/producttypes.js此处编写
 -->
<template>
    <div>
        <view-grid
                   ref="grid"
                   :columns="columns"
                   :detail="detail"
                   :editFormFields="editFormFields"
                   :editFormFileds="editFormFields"
                   :editFormOptions="editFormOptions"
                   :searchFormFields="searchFormFields"
                   :searchFormFileds="searchFormFields"
                   :searchFormOptions="searchFormOptions"
                   :table="table"
                   :extend="extend">
        </view-grid>
    </div>
</template>

<script>
    import extend from "@/extension/mall/Mall_hotel_type.js";
    import ViewGrid from "@/components/basic/ViewGrid.vue";
    var vueParam = {
        components: {
            ViewGrid
        },
        data() {
            return {
                table: {
                    key: 'id',
                    footer: "Foots",
                    cnName: '酒店类型',
                    name: 'producttypes',
                    url: "/hotelTypes/",
                    sortName: "2",
                    
                },
                extend: extend,
                editFormFields: {"parentID":"","typeCode":"","uiType":"","parentName":"","uiTypeName":"","typeName":"","parentIDe":"","attributes":[],"modifyDate":"","createDate":"","roleId":"","modifyID":"","createID":"","modifier":"","creator":"","isAvailable":"","isShow":""},
                editFormOptions: [ 
                                 [{"title":"类型名称","required":true,"field":"typeName","type":"text",colSize: 3},
                                 {"title":"父级类型","field":"parentName","type":"select","dataKey":"type_p",hidden:true,console:3},
                                // {"title":"类型名称","required":true,"field":"typeName","type":"text",hidden:true,colSize: 3},
                                 {"title":"父级类型","field":"parentID","type":"select","dataKey": "type_p",hidden:true,colSize: 3},
                                  {"title":"ui类型","required":true,"field":"uiType","type":"select","dataKey": "uiType"}
                                ],
                                 [{"title":"属性","field":"attributes","type":"checkbox","dataKey":"mall_type",colSize: 12}],
                                //  [
                                //      {
                                //             title: "属性",
                                //             //如果这里绑定了data数据，后台不会加载此数据源
                                //             data: [
                                //             { key: 1118, value:"房型"},
                                //             { key: 1117, value: "年月日(平日,周末,节假日)" },
                                //             { key: 1113, value: "淡旺季" },
                                //             { key: 1111, value: "时段" },
                                //             ],
                                //             field: "attributes",
                                //             type: "checkbox",
                                //             colSize: 10,
                                //         },
                                // ],
                                 [{"title":"是否可用","required":true,"field":"isAvailable","type":"switch",colSize: 5,},
                                  {"title":"是否展示","required":true,"field":"isShow","type":"switch"}],
                                  [{"title":"分销商编码","field":"roleId","dataKey":"distributor_Type",hidden:true}]],
                searchFormFields: {"typeCode":"","typeName":"","isAvailable":"","creator":"","createDate":"","modifyDate":""},
                searchFormOptions: [[{"title":"产品类型名称","field":"typeName","type":"like"},{"title":"ui类型","field":"uiType","type":"select","dataKey": "uiType"},{"title":"是否可用","field":"isAvailable","type":"select","dataKey":"enable"},],
                [{ "title": "创建时间", "field": "createDate", "type": "datetime" },{"title":"是否展示","field":"isShow","type":"select","dataKey":"enable"}, ],
                ],
                columns: [{field:'id',title:'主键',type:'int',width:90,hidden:true,readonly:true,require:true,align:'left'},
                       //{field:'typeCode',title:'产品类型编码',type:'string',width:220,align:'left',sortable:true},
                       {field:'typeName',title:'产品类型名称',type:'string',width:220,align:'left'},
                       {field:'attributeName',title:'属性',bind: { key: 'mall_type', data: [] },type:'string',width:280,align:'left'},
                       //{field:'attributeName',title:'属性名称',type:'string',width:120,align:'left'},
                    //    {field:'isDelete',title:'是否删除',type:'int',width:90,require:true,align:'left'},
                      // {field:'roleId',title:'分销商编码',type:'string',width:120,align:'left'},
                       {field:'uiType',title:'ui类型',bind: { key: 'uiType', data: [] },type:'string',width:100,align:'left'},
                       {field:'isAvailable',title:'是否可用',bind: { key: 'enable', data: [] },type:'int',width:90,align:'left'},
                       {field:'isShow',title:'是否展示',bind: { key: 'enable', data: [] },type:'int',width:90,align:'left'},
                       {field:'modifier',title:'修改人',type:'string',width:100,align:'left'},
                       {field:'modifyDate',title:'修改时间',type:'datetime',width:135,align:'left',sortable:true},
                       //{field:'modifyID',title:'修改人ID',type:'int',width:90,hidden:true,align:'left'},
                       {field:'createDate',title:'创建时间',type:'datetime',width:135,align:'left',sortable:true},
                       //{field:'createID',title:'创建人ID',type:'int',width:90,hidden:true,align:'left'},
                       {field:'creator',title:'创建人',type:'string',width:100,align:'left'},
                       
                       
                       ],
                detail: {
                    cnName:"#detailCnName",
                    columns: [],
                    sortName: "",
                    key:""
                }
            };
        }
    };
    export default vueParam;
</script>
